/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package utn.frsf.cidisi.upcolbpip.b2bcollaborations.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import utn.frsf.cidisi.upcolbpip.b2bcollaborations.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class B2bcollaborationsFactoryImpl extends EFactoryImpl implements B2bcollaborationsFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static B2bcollaborationsFactory init() {
		try {
			B2bcollaborationsFactory theB2bcollaborationsFactory = (B2bcollaborationsFactory)EPackage.Registry.INSTANCE.getEFactory("utn.frsf.cidisi.upcolbpip.b2bcollaborations"); 
			if (theB2bcollaborationsFactory != null) {
				return theB2bcollaborationsFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new B2bcollaborationsFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public B2bcollaborationsFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case B2bcollaborationsPackage.B2B_COLLABORATION: return createB2BCollaboration();
			case B2bcollaborationsPackage.COLLABORATIVE_AGREEMENT: return createCollaborativeAgreement();
			case B2bcollaborationsPackage.QUANTITATIVE_GOAL: return createQuantitativeGoal();
			case B2bcollaborationsPackage.QUALITATIVE_GOAL: return createQualitativeGoal();
			case B2bcollaborationsPackage.AGREEMENT_ATRIBUTE: return createAgreementAtribute();
			case B2bcollaborationsPackage.TRADING_PARTNER: return createTradingPartner();
			case B2bcollaborationsPackage.PARTNER_ROLE: return createPartnerRole();
			case B2bcollaborationsPackage.PUBLIC_BUSINESS_INTERFACE: return createPublicBusinessInterface();
			case B2bcollaborationsPackage.B2B_RELATIONSHIP: return createB2BRelationship();
			case B2bcollaborationsPackage.BUSINESS_DOCUMENT: return createBusinessDocument();
			case B2bcollaborationsPackage.BUSINESS_DOCUMENT_TYPE: return createBusinessDocumentType();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case B2bcollaborationsPackage.SPEECH_ACT:
				return createSpeechActFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case B2bcollaborationsPackage.SPEECH_ACT:
				return convertSpeechActToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public B2BCollaboration createB2BCollaboration() {
		B2BCollaborationImpl b2BCollaboration = new B2BCollaborationImpl();
		return b2BCollaboration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CollaborativeAgreement createCollaborativeAgreement() {
		CollaborativeAgreementImpl collaborativeAgreement = new CollaborativeAgreementImpl();
		return collaborativeAgreement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public QuantitativeGoal createQuantitativeGoal() {
		QuantitativeGoalImpl quantitativeGoal = new QuantitativeGoalImpl();
		return quantitativeGoal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public QualitativeGoal createQualitativeGoal() {
		QualitativeGoalImpl qualitativeGoal = new QualitativeGoalImpl();
		return qualitativeGoal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AgreementAtribute createAgreementAtribute() {
		AgreementAtributeImpl agreementAtribute = new AgreementAtributeImpl();
		return agreementAtribute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TradingPartner createTradingPartner() {
		TradingPartnerImpl tradingPartner = new TradingPartnerImpl();
		return tradingPartner;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PartnerRole createPartnerRole() {
		PartnerRoleImpl partnerRole = new PartnerRoleImpl();
		return partnerRole;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PublicBusinessInterface createPublicBusinessInterface() {
		PublicBusinessInterfaceImpl publicBusinessInterface = new PublicBusinessInterfaceImpl();
		return publicBusinessInterface;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public B2BRelationship createB2BRelationship() {
		B2BRelationshipImpl b2BRelationship = new B2BRelationshipImpl();
		return b2BRelationship;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BusinessDocument createBusinessDocument() {
		BusinessDocumentImpl businessDocument = new BusinessDocumentImpl();
		return businessDocument;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BusinessDocumentType createBusinessDocumentType() {
		BusinessDocumentTypeImpl businessDocumentType = new BusinessDocumentTypeImpl();
		return businessDocumentType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SpeechAct createSpeechActFromString(EDataType eDataType, String initialValue) {
		SpeechAct result = SpeechAct.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertSpeechActToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public B2bcollaborationsPackage getB2bcollaborationsPackage() {
		return (B2bcollaborationsPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static B2bcollaborationsPackage getPackage() {
		return B2bcollaborationsPackage.eINSTANCE;
	}

} //B2bcollaborationsFactoryImpl
